﻿using Bricks.Business.Models.Account;
using Bricks.Business.Models.Systems;
using Bricks.Component.Utils;
using Bricks.Site.Models.DBViewModel.Dictionary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bricks.Business.Service
{
    public interface IDictionaryService
    {
        #region 属性
        /// <summary>
        /// 获取 字典类型信息查询数据集
        /// </summary>
        IQueryable<DictionaryType> DictionaryTypes { get; }

        IQueryable<Dictionary> Dictionarys { get; }
        #endregion

        #region 公共方法
        /// <summary>
        /// 根据字典类型Tag获取字典列表
        /// </summary>
        /// <param name="typeTag"></param>
        /// <returns></returns>
        List<Dictionary> GetDictionaryByTypeTag(string typeTag);

        #region 字典类型
        /// <summary>
        /// 新增字典类型
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult AddType(DictionaryType model);

        /// <summary>
        /// 修改字典类型
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult ModifyType(DictionaryType model);

        /// <summary>
        /// 删除字典类型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        OperationResult DeleteType(Guid id);

        /// <summary>
        /// 排序设置字典类型(向上向下)
        /// </summary>
        /// <param name="id"></param>
        /// <param name="pid"></param>
        /// <param name="upOrDown"></param>
        /// <returns></returns>
        OperationResult SetOrderType(Guid id, string upOrDown);
        #endregion

        #region 字典
        /// <summary>
        /// 新增字典
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult AddDictionary(Dictionary model);

        /// <summary>
        /// 修改字典
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperationResult ModifyDictionary(Dictionary model);

        /// <summary>
        /// 删除字典
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        OperationResult DeleteDictionary(Guid id);

        /// <summary>
        /// 排序设置字典(向上向下)
        /// </summary>
        /// <param name="id"></param>
        /// <param name="pid"></param>
        /// <param name="upOrDown"></param>
        /// <returns></returns>
        OperationResult SetOrderDictionary(Guid id, string upOrDown);
        #endregion

        #region 数据库视图字典获取
        List<VMDictionaryInfo> GetVMDictionaryInfo();
        #endregion
        #endregion
    }
}
